Demo License Model

Developing Applications Using The SoftwareShield System > Creating Licensing Solutions > Available License Models > Demo License Model

## Demo License Model

This model allows you to deliver a feature limited version of your software. Before the user purchases or registers your software, they only access to a sub-set of the total features your application offers. Once activated, they have access to the full functionality.

### Overview - How to Integrate the Demo License Model Into Your Application

There are at least two basic mechanisms to integrate the Demo License Model into your application. In either one, you will use a secure license state to serve as the "demo lock". If the demo lock is not activated - you must run the software in demo mode, and once activated - you must run it in full-feature mode.

The two approaches are:

1. You can use the Copy-Protection feature to serve as the lock on the full version. If Copy-Protection has been released for this machine, then the lock has been released.

2. You can use a General Use Authorization Definition to serve as the lock. If that particular definition has been activated, then the lock for this machine has been released. Note that if you pick this method, it does preclude you from using Copy-Protection. It just means that you will be interpreting a different state aspect of the users license to determine if the demo-lock has been released.

Once you have decided your basic approach, design the license:

1. Ensure that your license has the necessary Authorization Definitions built into it. You decide which definitions to include based on your approach. If you use the Copy-Protection approach, see Copy Protection License Model. If you use the General Use Authorization Definition approach, simply ensure you have a General Use Authorization Definition.

2. Once you are satisfied with your license, compile a distributed copy of it. The distributed copy is encrypted and compressed and only contains absolutely necessary information for the enforcement of your license. Place a copy of this distributed license in your applications directory. If you have decided to use steganographic alias files, make sure that they are also in the application directory. Have a look at the programming notes file that the SoftwareShield License Manager creates for your specific license. This will make your programming a little easier by supplying you with the code you will need to invoke the start up event. Please see Deploying the License for Your Application for more detailed information about deploying your license.

3. Next, in your programs startup event (main form load etc.) create an instance of the ClientProtector object (SSCProtector) and immediately call its StartUp function. You will have to pass specific parameters such as the license name, main license file password, and the finger print options code - but this code will have been already written for your convenience when you compiled your license - just look in the programming notes file created by the SoftwareShield License Manager. Have a look at the exact details of the StartUp function for more information on making this call.

Either way you go, the basic premise is the same for checking the state of the demo-lock at run-time: Run in "demo mode" if the state aspect of your license that you are logically interpreting as the demo-lock is not activated - and run in "full-feature-mode" if it is.

1. If using the Copy-Protection method, follow the instructions for Integrating the Copy Protection License Model. However, instead of shutting down when the license state return_code indicates that Copy-Protection has not been released for this users machine - run in "demo mode". If it has been released - run in "full-feature-mode".

2. If using the General Use Authorization Definition method, simply query the definition (via: GetAuthorizationDetails or GetAuthorizationDetailsEx) to determine if the demo-lock has been released based on the definitions Activated state.